package com.bwie.patient.controller;

import com.bwie.common.core.domain.Result;
import com.bwie.patient.domain.po.PatientPrescriptionDTO;
import com.bwie.patient.domain.vo.PrescriptionVo;
import com.bwie.patient.service.PatientPrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("patientPrescription")
@CrossOrigin
public class PatientPrescriptionController {
    /**
     * 注入
     */
    @Autowired
    private PatientPrescriptionService prescriptionService;

    /**
     * 查询处方
     * @param patientPrescriptionDTO
     * @return
     */
    @GetMapping("list")
    public Result<List<PrescriptionVo>> list(PatientPrescriptionDTO patientPrescriptionDTO){
        //根据状态和单号查询列表
        List<PrescriptionVo> list = prescriptionService.getList(patientPrescriptionDTO);
        //返回
        return Result.success(list);
    }



}